﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>查询相应转录本对应的外显子</title>
</head>
	<body>
	<%
	Connection conn = null;
	Statement stmt = null;
	ResultSet rs = null;
	
	String url="jdbc:mysql://localhost/gene";
	String user="root";
	String pwd="gyl20030217";
			
	Class.forName("com.mysql.cj.jdbc.Driver");
	conn=DriverManager.getConnection(url,user,pwd);
	stmt = conn.createStatement();
	String sql = "select transcript_id,exon_id,start,end,ranks "
			+ "from exon55 join exon_transcript55 using (exon_id) "
			+ "where transcript_id =11145020";
	rs = stmt.executeQuery(sql);
	%>

	<p>transcript_id为11145020的转录本所对应的外显子为:</p>
	<table border="1">
	<tr>
	<td>transcript_id</td><td>start</td><td>end</td><td>ranks</td>
	</tr>

	<%
	String id,start,end,ranks;
	while (rs.next()){
		id = rs.getString("transcript_id");
		start  =rs.getString("start");
		end = rs.getString("end");
		ranks = rs.getString("ranks");
	%>
		<tr>
		<td><%=id%></td><td><%=start%></td><td><%=end%></td><td><%=ranks%>
		</tr>
	<%
	}
	%>
	
	<%
	if(rs!=null){
		rs.close();
	}
	if(stmt!=null){
		stmt.close();
		}
	if(conn!=null){
		conn.close();
		}
	%>
	</body>
</html>